package xyz.ieden.commons.entity;

import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 使用 fastJson 解析器
 */
public class Book implements Serializable {
    private static final long serialVersionUID = 6272573641739519421L;

    private Integer id;
    private String name;
    private String title;
    private List<String> tagList;
    private String content;
    @JSONField(serialize = false)
    private String vipContent;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    public Book() {
    }

    public Book(Integer id, String name, String title, List<String> tagList, String content, String vipContent, Date createDate) {
        this.id = id;
        this.name = name;
        this.title = title;
        this.tagList = tagList;
        this.content = content;
        this.vipContent = vipContent;
        this.createDate = createDate;
    }

    // Setter and Getter Method
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<String> getTagList() {
        return tagList;
    }

    public void setTagList(List<String> tagList) {
        this.tagList = tagList;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getVipContent() {
        return vipContent;
    }

    public void setVipContent(String vipContent) {
        this.vipContent = vipContent;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
